package com.rxz.controller;

import com.rxz.entity.Result;
import com.rxz.entity.Users;
import com.rxz.service.impl.UserLoginServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("rxz")
public class UserController {

    @Autowired
    private UserLoginServiceImpl userLoginService;

    @PostMapping("/login")
    public Result login(@RequestBody Users user){
        return userLoginService.login(user);
    }

    @GetMapping("/getToken")
    public Result getToken(@RequestParam String token){
        return userLoginService.getUserInfoByToken(token);
    }
}
